Crate binator_core
source ·Expand description
Terminology:
Name | Description |
---|---|
Stream | A structure that would produce Item when asked |
Parser | Something that will check that Item produced by Stream are correct |
Context | A structure that will manage Failure from Parser |
Token | Represent what a Parser return for Success |
Atom | A structure that contain information about the Failure or Error from a Parser |
Element | Something, generally an enumeration, that will contain all different kind of Atom |
Parsed | Enumeration that indicate result of a Parser |
Parse | A trait that all Parser implement, used to use a Parser |
Failure | Indicate a Parser didn’t validate the input |
Success | Indicate a Parser validate the input |
Error | Indicate a Parser encounter an irrecoverable error. |
Streaming | A trait that Stream implement to make their job |
Item | Item produced by a Stream , generally just an u8 |
Span | A delimited part of the Stream |
Contexting | A trait that all Context will implement, used to accumulate failure of Parser |
Structs§
- This represent a stand alone Success from Parsed result.
Enums§
- Core context used to implement context for basic type like u8
- Parsed represent the result of a
parse()
. - This is like Parsed but Succeed doesn’t contain stream
- Represent split Result
Traits§
- This is very usefull to be use on combinator like fold. For example,
.fold_bounds(.., Vec::new, Acc::acc)
. - Contexting is a trait used to report failure and error. This idea is too have a tree of context that will help final user to understand the error. It’s can also help for debugging purpose.
- Abstracts something which can extend an
&mut self
. - Parse is a trait that all parsers should implement. There is a blanked implementation for type that implement FnMut that match signature of parse(). This mean you can quickly use a function to implement a Parser.
- This is an utily trait
- Abstracts something which can push Item into self
- This trait must be implement by all struct that want to be a stream for binator.
- This is very usefull to be use on combinator like try_fold. For example,
.try_fold_bounds(.., || Ok(Vec::new), TryAcc::try_acc)
. - Abstracts something which can try extend
&mut self
. - Abstracts something you can try push item into
&mut self